﻿namespace Lonntec.DevClient
{
    using DevExpress.Utils;
    using DevExpress.XtraBars;
    using DevExpress.XtraBars.Docking;
    using DevExpress.XtraEditors;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraNavBar;
    using DevExpress.XtraTabbedMdi;
    using Furious.Common;
    using Lonntec.Business;
    using Lonntec.DevClient.Properties;
    using Lonntec.UI;
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Text.RegularExpressions;
    using System.Windows.Forms;

    public class MainForm : XtraMainForm
    {
        private BarDockControl barDockControlBottom;
        private BarDockControl barDockControlLeft;
        private BarDockControl barDockControlRight;
        private BarDockControl barDockControlTop;
        private Bar barMainMenu;
        private BarManager barManager;
        private Bar barTool;
        private BarButtonItem btnAccount;
        private BarButtonItem btnCodeRule;
        private BarButtonItem btnFunctionalTree;
        private BarButtonItem btnIcons;
        private BarButtonItem btnMdLogical;
        private BarButtonItem btnMdSmartSource;
        private BarButtonItem btnMdSource;
        private BarButtonItem btnMdTableInfo;
        private BarButtonItem btnPermissionTemplate;
        private BarButtonItem btnPerssionList;
        private BarButtonItem btnPrintSetting;
        private BarButtonItem btnReportTemplate;
        private BarButtonItem btnRole;
        private BarButtonItem btnSqlClient;
        private BarButtonItem btnSqlScript;
        private BarButtonItem btnUser;
        private IContainer components;
        private DefaultToolTipController defaultToolTipController;
        private DockManager dockManager;
        private ControlContainer dockPanel1_Container;
        private DockPanel dpNav;
        private NavBarControl navBar;
        private SplitterControl splitterControl1;
        private BarSubItem subMenuAccount;
        private BarSubItem subMenuMetadata;
        private BarSubItem subMenuSystem;
        private XtraTabbedMdiManager xtraTabbedMdiManager;

        public MainForm()
        {
            this.InitializeComponent();
        }

        private void BarButtonItemClick(object sender, ItemClickEventArgs e)
        {
            Cursor current = Cursor.Current;
            try
            {
                Cursor.Current = Cursors.WaitCursor;
                if ((e.Item.Tag != null) && (e.Item.Tag is FunctionalInfo))
                {
                    FunctionalInfo tag = (FunctionalInfo) e.Item.Tag;
                    IFunctional functional = this.CreateFunctional(tag);
                    this.Register(functional);
                    this.Active(tag.Id);
                }
            }
            finally
            {
                Cursor.Current = current;
            }
        }

        private void CreateNavBar()
        {
            foreach (BarItemLink link in this.barMainMenu.ItemLinks)
            {
                if (link.Item is BarSubItem)
                {
                    NavBarGroup group = this.navBar.Groups.Add();
                    group.LargeImage = link.LargeGlyph;
                    group.SmallImage = link.Glyph;
                    group.Caption = link.Caption;
                    foreach (BarItemLink link2 in ((BarSubItem) link.Item).ItemLinks)
                    {
                        NavBarItem item = this.navBar.Items.Add();
                        item.Caption = GetCaptionFromMenuItem(link2.Caption);
                        item.SmallImage = link2.Glyph;
                        item.Tag = link2.Item;
                        item.LinkClicked += new NavBarLinkEventHandler(MainForm.NavBarItemClick);
                        group.ItemLinks.Add(item);
                    }
                    group.Expanded = true;
                    this.navBar.Groups.Add(group);
                }
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        private static string GetCaptionFromMenuItem(string sourceCaption)
        {
            return Regex.Replace(sourceCaption, @"\(.+\).*", string.Empty);
        }

        private void InitFunctionalInfos()
        {
            FunctionalInfo info = new FunctionalInfo();
            info.Id = Guid.NewGuid();
            info.Key = "Func_Icons";
            info.Caption = GetCaptionFromMenuItem(this.btnIcons.Caption);
            info.Glyph = this.btnFunctionalTree.Glyph;
            this.LinkButtonItemClick(info, this.btnIcons);
            FunctionalInfo info2 = new FunctionalInfo();
            info2.Id = Guid.NewGuid();
            info2.Key = "Func_Accounts";
            info2.Caption = GetCaptionFromMenuItem(this.btnAccount.Caption);
            info2.Glyph = this.btnAccount.Glyph;
            this.LinkButtonItemClick(info2, this.btnAccount);
            FunctionalInfo info3 = new FunctionalInfo();
            info3.Id = Guid.NewGuid();
            info3.Key = "Func_Roles";
            info3.Caption = GetCaptionFromMenuItem(this.btnRole.Caption);
            info3.Glyph = this.btnRole.Glyph;
            this.LinkButtonItemClick(info3, this.btnRole);
            FunctionalInfo info4 = new FunctionalInfo();
            info4.Id = Guid.NewGuid();
            info4.Key = "Func_Users";
            info4.Caption = GetCaptionFromMenuItem(this.btnUser.Caption);
            info4.Glyph = this.btnUser.Glyph;
            this.LinkButtonItemClick(info4, this.btnUser);
            FunctionalInfo info5 = new FunctionalInfo();
            info5.Id = Guid.NewGuid();
            info5.Key = "Func_Metadata";
            info5.Caption = GetCaptionFromMenuItem(this.btnMdSource.Caption);
            info5.Glyph = this.btnMdSource.Glyph;
            this.LinkButtonItemClick(info5, this.btnMdSource);
            FunctionalInfo info6 = new FunctionalInfo();
            info6.Id = Guid.NewGuid();
            info6.Key = "Func_FuncTree";
            info6.Caption = GetCaptionFromMenuItem(this.btnFunctionalTree.Caption);
            info6.Glyph = this.btnFunctionalTree.Glyph;
            this.LinkButtonItemClick(info6, this.btnFunctionalTree);
            FunctionalInfo info7 = new FunctionalInfo();
            info7.Id = Guid.NewGuid();
            info7.Key = "Func_SchemaTemplate";
            info7.Caption = GetCaptionFromMenuItem(this.btnPermissionTemplate.Caption);
            info7.Glyph = this.btnPermissionTemplate.Glyph;
            this.LinkButtonItemClick(info7, this.btnPermissionTemplate);
            FunctionalInfo info8 = new FunctionalInfo();
            info8.Id = Guid.NewGuid();
            info8.Key = "Func_SqlScript";
            info8.Caption = GetCaptionFromMenuItem(this.btnSqlScript.Caption);
            info8.Glyph = this.btnSqlScript.Glyph;
            this.LinkButtonItemClick(info8, this.btnSqlScript);
            FunctionalInfo info9 = new FunctionalInfo();
            info9.Id = Guid.NewGuid();
            info9.Key = "Func_MetadataLogical";
            info9.Caption = GetCaptionFromMenuItem(this.btnMdLogical.Caption);
            info9.Glyph = this.btnMdLogical.Glyph;
            this.LinkButtonItemClick(info9, this.btnMdLogical);
            FunctionalInfo info10 = new FunctionalInfo();
            info10.Id = Guid.NewGuid();
            info10.Key = "Func_MetadataSmartSource";
            info10.Caption = GetCaptionFromMenuItem(this.btnMdSmartSource.Caption);
            info10.Glyph = this.btnMdSmartSource.Glyph;
            this.LinkButtonItemClick(info10, this.btnMdSmartSource);
            FunctionalInfo info11 = new FunctionalInfo();
            info11.Id = Guid.NewGuid();
            info11.Key = "Func_DbInfo";
            info11.Caption = GetCaptionFromMenuItem(this.btnMdTableInfo.Caption);
            info11.Glyph = this.btnMdTableInfo.Glyph;
            this.LinkButtonItemClick(info11, this.btnMdTableInfo);
            FunctionalInfo info12 = new FunctionalInfo();
            info12.Id = Guid.NewGuid();
            info12.Key = "Func_CodeRule";
            info12.Caption = GetCaptionFromMenuItem(this.btnCodeRule.Caption);
            info12.Glyph = this.btnCodeRule.Glyph;
            this.LinkButtonItemClick(info12, this.btnCodeRule);
            FunctionalInfo info13 = new FunctionalInfo();
            info13.Id = Guid.NewGuid();
            info13.Key = "Func_ReportTemplate";
            info13.Caption = GetCaptionFromMenuItem(this.btnReportTemplate.Caption);
            info13.Glyph = this.btnReportTemplate.Glyph;
            this.LinkButtonItemClick(info13, this.btnReportTemplate);
            FunctionalInfo info14 = new FunctionalInfo();
            info14.Id = Guid.NewGuid();
            info14.Key = "Func_SqlScriptClient";
            info14.Caption = GetCaptionFromMenuItem(this.btnSqlClient.Caption);
            info14.Glyph = this.btnSqlClient.Glyph;
            this.LinkButtonItemClick(info14, this.btnSqlClient);
            FunctionalInfo info15 = new FunctionalInfo();
            info15.Id = Guid.NewGuid();
            info15.Key = "Func_PrintSetting";
            info15.Caption = GetCaptionFromMenuItem(this.btnPrintSetting.Caption);
            info15.Glyph = this.btnPrintSetting.Glyph;
            this.LinkButtonItemClick(info15, this.btnPrintSetting);
        }

        private void InitializeComponent()
        {
            this.components = new Container();
            this.barManager = new BarManager(this.components);
            this.barMainMenu = new Bar();
            this.subMenuSystem = new BarSubItem();
            this.btnIcons = new BarButtonItem();
            this.btnFunctionalTree = new BarButtonItem();
            this.btnPermissionTemplate = new BarButtonItem();
            this.btnCodeRule = new BarButtonItem();
            this.btnReportTemplate = new BarButtonItem();
            this.btnPrintSetting = new BarButtonItem();
            this.subMenuAccount = new BarSubItem();
            this.btnAccount = new BarButtonItem();
            this.btnRole = new BarButtonItem();
            this.btnUser = new BarButtonItem();
            this.btnPerssionList = new BarButtonItem();
            this.subMenuMetadata = new BarSubItem();
            this.btnMdSource = new BarButtonItem();
            this.btnMdLogical = new BarButtonItem();
            this.btnMdSmartSource = new BarButtonItem();
            this.btnMdTableInfo = new BarButtonItem();
            this.btnSqlClient = new BarButtonItem();
            this.btnSqlScript = new BarButtonItem();
            this.barTool = new Bar();
            this.barDockControlTop = new BarDockControl();
            this.barDockControlBottom = new BarDockControl();
            this.barDockControlLeft = new BarDockControl();
            this.barDockControlRight = new BarDockControl();
            this.dockManager = new DockManager(this.components);
            this.dpNav = new DockPanel();
            this.dockPanel1_Container = new ControlContainer();
            this.navBar = new NavBarControl();
            this.xtraTabbedMdiManager = new XtraTabbedMdiManager(this.components);
            this.defaultToolTipController = new DefaultToolTipController(this.components);
            this.splitterControl1 = new SplitterControl();
            this.barManager.BeginInit();
            this.dockManager.BeginInit();
            this.dpNav.SuspendLayout();
            this.dockPanel1_Container.SuspendLayout();
            this.navBar.BeginInit();
            ((ISupportInitialize) this.xtraTabbedMdiManager).BeginInit();
            base.SuspendLayout();
            this.barManager.Bars.AddRange(new Bar[] { this.barMainMenu, this.barTool });
            this.barManager.Categories.AddRange(new BarManagerCategory[] { new BarManagerCategory("系统设置", new Guid("6155b944-5ad6-4d79-b32b-5b57372654a0")), new BarManagerCategory("帐套管理", new Guid("e2b47511-a2cb-47c3-9c85-ba601eaa626a")) });
            this.barManager.DockControls.Add(this.barDockControlTop);
            this.barManager.DockControls.Add(this.barDockControlBottom);
            this.barManager.DockControls.Add(this.barDockControlLeft);
            this.barManager.DockControls.Add(this.barDockControlRight);
            this.barManager.DockManager = this.dockManager;
            this.barManager.Form = this;
            this.barManager.Items.AddRange(new BarItem[] { 
                this.subMenuSystem, this.btnAccount, this.btnRole, this.btnUser, this.btnIcons, this.btnFunctionalTree, this.btnPermissionTemplate, this.btnPerssionList, this.subMenuAccount, this.subMenuMetadata, this.btnMdSource, this.btnMdLogical, this.btnPrintSetting, this.btnMdSmartSource, this.btnMdTableInfo, this.btnSqlClient, 
                this.btnSqlScript, this.btnCodeRule, this.btnReportTemplate
             });
            this.barManager.MainMenu = this.barMainMenu;
            this.barManager.MaxItemId = 0x20;
            this.barMainMenu.BarName = "Main menu";
            this.barMainMenu.DockCol = 0;
            this.barMainMenu.DockRow = 0;
            this.barMainMenu.DockStyle = BarDockStyle.Top;
            this.barMainMenu.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.subMenuSystem), new LinkPersistInfo(this.subMenuAccount), new LinkPersistInfo(this.subMenuMetadata) });
            this.barMainMenu.OptionsBar.MultiLine = true;
            this.barMainMenu.OptionsBar.UseWholeRow = true;
            this.barMainMenu.Text = "Main menu";
            this.subMenuSystem.Caption = "系统设置";
            this.subMenuSystem.Glyph = GraphicRes.MainForm_NavGroup_Small;
            this.subMenuSystem.Id = 3;
            this.subMenuSystem.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.btnIcons), new LinkPersistInfo(this.btnFunctionalTree), new LinkPersistInfo(BarLinkUserDefines.PaintStyle, this.btnPermissionTemplate, BarItemPaintStyle.Standard), new LinkPersistInfo(this.btnCodeRule), new LinkPersistInfo(this.btnReportTemplate), new LinkPersistInfo(this.btnPrintSetting) });
            this.subMenuSystem.Name = "subMenuSystem";
            this.btnIcons.Caption = "图标资源管理(&I)…";
            this.btnIcons.CategoryGuid = new Guid("6155b944-5ad6-4d79-b32b-5b57372654a0");
            this.btnIcons.Glyph = GraphicRes.MainForm_Icons;
            this.btnIcons.Id = 10;
            this.btnIcons.Name = "btnIcons";
            this.btnFunctionalTree.Caption = "功能清单管理(&F)…";
            this.btnFunctionalTree.CategoryGuid = new Guid("6155b944-5ad6-4d79-b32b-5b57372654a0");
            this.btnFunctionalTree.Glyph = GraphicRes.MainForm_FunctionalTree;
            this.btnFunctionalTree.Id = 8;
            this.btnFunctionalTree.Name = "btnFunctionalTree";
            this.btnPermissionTemplate.Caption = "权限模板管理(&T)…";
            this.btnPermissionTemplate.CategoryGuid = new Guid("6155b944-5ad6-4d79-b32b-5b57372654a0");
            this.btnPermissionTemplate.Glyph = GraphicRes.MainForm_PermissionTemplate;
            this.btnPermissionTemplate.Id = 9;
            this.btnPermissionTemplate.Name = "btnPermissionTemplate";
            this.btnCodeRule.Caption = "编码规则设置(&C)";
            this.btnCodeRule.CategoryGuid = new Guid("6155b944-5ad6-4d79-b32b-5b57372654a0");
            this.btnCodeRule.Glyph = GraphicRes.Common_Plugin;
            this.btnCodeRule.Id = 20;
            this.btnCodeRule.Name = "btnCodeRule";
            this.btnReportTemplate.Caption = "公共报表模板(&R)";
            this.btnReportTemplate.CategoryGuid = new Guid("6155b944-5ad6-4d79-b32b-5b57372654a0");
            this.btnReportTemplate.Glyph = GraphicRes.Simg_Report;
            this.btnReportTemplate.Id = 0x15;
            this.btnReportTemplate.Name = "btnReportTemplate";
            this.btnPrintSetting.Caption = "远程打印设置";
            this.btnPrintSetting.Glyph = GraphicRes.world_link;
            this.btnPrintSetting.Id = 0x1f;
            this.btnPrintSetting.Name = "btnPrintSetting";
            this.subMenuAccount.Caption = "帐套设置";
            this.subMenuAccount.Glyph = GraphicRes.MainForm_NavGroup_Small;
            this.subMenuAccount.Id = 14;
            this.subMenuAccount.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.btnAccount), new LinkPersistInfo(this.btnRole), new LinkPersistInfo(this.btnUser), new LinkPersistInfo(this.btnPerssionList) });
            this.subMenuAccount.Name = "subMenuAccount";
            this.btnAccount.Caption = "帐套连接设置(&A)…";
            this.btnAccount.CategoryGuid = new Guid("e2b47511-a2cb-47c3-9c85-ba601eaa626a");
            this.btnAccount.Glyph = GraphicRes.MainForm_ErpAccount;
            this.btnAccount.Id = 4;
            this.btnAccount.Name = "btnAccount";
            this.btnRole.Caption = "用户角色及权限(&R)…";
            this.btnRole.CategoryGuid = new Guid("e2b47511-a2cb-47c3-9c85-ba601eaa626a");
            this.btnRole.Glyph = GraphicRes.MainForm_Roles;
            this.btnRole.Id = 5;
            this.btnRole.Name = "btnRole";
            this.btnUser.Caption = "系统用户管理(&U)…";
            this.btnUser.CategoryGuid = new Guid("e2b47511-a2cb-47c3-9c85-ba601eaa626a");
            this.btnUser.Glyph = GraphicRes.MainForm_User;
            this.btnUser.Id = 6;
            this.btnUser.Name = "btnUser";
            this.btnPerssionList.Caption = "权限清单查阅(&P)…";
            this.btnPerssionList.CategoryGuid = new Guid("e2b47511-a2cb-47c3-9c85-ba601eaa626a");
            this.btnPerssionList.Glyph = GraphicRes.MainForm_PermissionView;
            this.btnPerssionList.Id = 7;
            this.btnPerssionList.Name = "btnPerssionList";
            this.subMenuMetadata.Caption = "元数据";
            this.subMenuMetadata.Id = 0x10;
            this.subMenuMetadata.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.btnMdSource), new LinkPersistInfo(this.btnMdLogical), new LinkPersistInfo(this.btnMdSmartSource), new LinkPersistInfo(this.btnMdTableInfo, true), new LinkPersistInfo(this.btnSqlClient), new LinkPersistInfo(this.btnSqlScript) });
            this.subMenuMetadata.Name = "subMenuMetadata";
            this.btnMdSource.Caption = "物理元数据";
            this.btnMdSource.Glyph = GraphicRes.Metadata_Source;
            this.btnMdSource.Id = 0x11;
            this.btnMdSource.Name = "btnMdSource";
            this.btnMdLogical.Caption = "逻辑元数据";
            this.btnMdLogical.Glyph = GraphicRes.Metadata_Logical;
            this.btnMdLogical.Id = 0x12;
            this.btnMdLogical.Name = "btnMdLogical";
            this.btnMdSmartSource.Caption = "Smart Source 设置";
            this.btnMdSmartSource.Glyph = GraphicRes.Metadata_SmartSource;
            this.btnMdSmartSource.Id = 0x1c;
            this.btnMdSmartSource.Name = "btnMdSmartSource";
            this.btnMdTableInfo.Caption = "数据库管理";
            this.btnMdTableInfo.Glyph = GraphicRes.MainForm_TableInfos;
            this.btnMdTableInfo.Id = 0x1d;
            this.btnMdTableInfo.Name = "btnMdTableInfo";
            this.btnSqlClient.Caption = "数据库客户端";
            this.btnSqlClient.Glyph = Resources.Common_SqlClient;
            this.btnSqlClient.Id = 30;
            this.btnSqlClient.Name = "btnSqlClient";
            this.btnSqlScript.Caption = "数据库访问脚本";
            this.btnSqlScript.Glyph = GraphicRes.Metadata_Script;
            this.btnSqlScript.Id = 0x13;
            this.btnSqlScript.Name = "btnSqlScript";
            this.barTool.BarName = "Toolbar";
            this.barTool.DockCol = 0;
            this.barTool.DockRow = 1;
            this.barTool.DockStyle = BarDockStyle.Top;
            this.barTool.LinksPersistInfo.AddRange(new LinkPersistInfo[] { new LinkPersistInfo(this.btnFunctionalTree), new LinkPersistInfo(this.btnIcons), new LinkPersistInfo(this.btnPermissionTemplate), new LinkPersistInfo(this.btnAccount, true), new LinkPersistInfo(this.btnRole), new LinkPersistInfo(this.btnUser), new LinkPersistInfo(this.btnPerssionList) });
            this.barTool.Text = "Toolbar";
            this.defaultToolTipController.SetAllowHtmlText(this.barDockControlTop, DefaultBoolean.Default);
            this.barDockControlTop.Dock = DockStyle.Top;
            this.barDockControlTop.Location = new Point(0, 0);
            this.barDockControlTop.Size = new Size(0x3f0, 0x36);
            this.defaultToolTipController.SetAllowHtmlText(this.barDockControlBottom, DefaultBoolean.Default);
            this.barDockControlBottom.Dock = DockStyle.Bottom;
            this.barDockControlBottom.Location = new Point(0, 730);
            this.barDockControlBottom.Size = new Size(0x3f0, 0);
            this.defaultToolTipController.SetAllowHtmlText(this.barDockControlLeft, DefaultBoolean.Default);
            this.barDockControlLeft.Dock = DockStyle.Left;
            this.barDockControlLeft.Location = new Point(0, 0x36);
            this.barDockControlLeft.Size = new Size(0, 0x2a4);
            this.defaultToolTipController.SetAllowHtmlText(this.barDockControlRight, DefaultBoolean.Default);
            this.barDockControlRight.Dock = DockStyle.Right;
            this.barDockControlRight.Location = new Point(0x3f0, 0x36);
            this.barDockControlRight.Size = new Size(0, 0x2a4);
            this.dockManager.Form = this;
            this.dockManager.RootPanels.AddRange(new DockPanel[] { this.dpNav });
            this.dockManager.TopZIndexControls.AddRange(new string[] { "DevExpress.XtraBars.BarDockControl", "DevExpress.XtraBars.StandaloneBarDockControl", "System.Windows.Forms.StatusBar", "DevExpress.XtraBars.Ribbon.RibbonStatusBar", "DevExpress.XtraBars.Ribbon.RibbonControl" });
            this.dpNav.Controls.Add(this.dockPanel1_Container);
            this.dpNav.Dock = DockingStyle.Left;
            this.dpNav.ID = new Guid("d7f4165b-389d-46dc-b737-11e8b74807df");
            this.dpNav.Location = new Point(0, 0x36);
            this.dpNav.Name = "dpNav";
            this.dpNav.OriginalSize = new Size(200, 200);
            this.dpNav.Size = new Size(200, 0x2a4);
            this.dpNav.Text = "功能导航栏";
            this.defaultToolTipController.SetAllowHtmlText(this.dockPanel1_Container, DefaultBoolean.Default);
            this.dockPanel1_Container.Controls.Add(this.navBar);
            this.dockPanel1_Container.Location = new Point(3, 0x19);
            this.dockPanel1_Container.Name = "dockPanel1_Container";
            this.dockPanel1_Container.Size = new Size(0xc2, 0x288);
            this.dockPanel1_Container.TabIndex = 0;
            this.navBar.ActiveGroup = null;
            this.navBar.BorderStyle = BorderStyles.NoBorder;
            this.navBar.Dock = DockStyle.Fill;
            this.navBar.Location = new Point(0, 0);
            this.navBar.Name = "navBar";
            this.navBar.OptionsNavPane.ExpandedWidth = 0xc2;
            this.navBar.Size = new Size(0xc2, 0x288);
            this.navBar.TabIndex = 0;
            this.navBar.Text = "navBarControl1";
            this.xtraTabbedMdiManager.MdiParent = this;
            this.xtraTabbedMdiManager.ToolTipController = this.defaultToolTipController.DefaultController;
            this.defaultToolTipController.DefaultController.Appearance.Options.UseTextOptions = true;
            this.defaultToolTipController.DefaultController.Appearance.TextOptions.WordWrap = WordWrap.Wrap;
            this.defaultToolTipController.DefaultController.Rounded = true;
            this.defaultToolTipController.DefaultController.ShowBeak = true;
            this.defaultToolTipController.SetAllowHtmlText(this.splitterControl1, DefaultBoolean.Default);
            this.splitterControl1.Location = new Point(200, 0x36);
            this.splitterControl1.Name = "splitterControl1";
            this.splitterControl1.Size = new Size(6, 0x2a4);
            this.splitterControl1.TabIndex = 6;
            this.splitterControl1.TabStop = false;
            this.defaultToolTipController.SetAllowHtmlText(this, DefaultBoolean.Default);
            base.AutoScaleDimensions = new SizeF(7f, 14f);
            base.AutoScaleMode = AutoScaleMode.Font;
            base.ClientSize = new Size(0x3f0, 730);
            base.Controls.Add(this.splitterControl1);
            base.Controls.Add(this.dpNav);
            base.Controls.Add(this.barDockControlLeft);
            base.Controls.Add(this.barDockControlRight);
            base.Controls.Add(this.barDockControlBottom);
            base.Controls.Add(this.barDockControlTop);
            base.Name = "MainForm";
            base.StartPosition = FormStartPosition.CenterScreen;
            this.Text = "MainForm";
            base.Controls.SetChildIndex(this.barDockControlTop, 0);
            base.Controls.SetChildIndex(this.barDockControlBottom, 0);
            base.Controls.SetChildIndex(this.barDockControlRight, 0);
            base.Controls.SetChildIndex(this.barDockControlLeft, 0);
            base.Controls.SetChildIndex(this.dpNav, 0);
            base.Controls.SetChildIndex(this.splitterControl1, 0);
            this.barManager.EndInit();
            this.dockManager.EndInit();
            this.dpNav.ResumeLayout(false);
            this.dockPanel1_Container.ResumeLayout(false);
            this.navBar.EndInit();
            ((ISupportInitialize) this.xtraTabbedMdiManager).EndInit();
            base.ResumeLayout(false);
        }

        private void LinkButtonItemClick(FunctionalInfo info, BarButtonItem item)
        {
            item.Tag = info;
            item.ItemClick += new ItemClickEventHandler(this.BarButtonItemClick);
        }

        private static void NavBarItemClick(object sender, NavBarLinkEventArgs e)
        {
            ((BarButtonItem) e.Link.Item.Tag).PerformClick();
        }

        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            this.Text = (string) Global.Instance["ApplicationTitle"];
            this.CreateNavBar();
            this.InitFunctionalInfos();
        }

        protected override BarManager CurrentBarManager
        {
            get
            {
                return this.barManager;
            }
        }

        protected override XtraTabbedMdiManager CurrentMdiManager
        {
            get
            {
                return this.xtraTabbedMdiManager;
            }
        }
    }
}

